<?php namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class SearchAll extends Model {

	//
	protected $table = "search_all";
	protected $fillable = ['name', 'description', 'uid', 'type', 'pid'];

	public function energy()
	{
		return $this->hasOne("App\Models\EnterpricePowerusersBase", "id", "pid");
	}

	public function saver()
	{
		return $this->hasOne("App\Models\EnterpriceEnergysaverBase", "id", "pid");
	}

	public function devicetech()
	{
		return $this->hasOne("App\Models\DevicetechProviderBase", "id", "pid");
	}

	public function third()
	{
		return $this->hasOne("App\Models\ThirdpartyBase", "id", "pid");
	}

	public function ass()
	{
		return $this->hasOne("App\Models\AssociationBase", "id", "pid");
	}

	public function gov()
	{
		return $this->hasOne("App\Models\GovernmentBase", "id", "pid");
	}

	public function project()
	{
		return $this->hasOne("App\Models\Projects", "id", "pid");
	}

	public function tech()
	{
		return $this->hasOne("App\Models\Technologies", "id", "pid");
	}

	public function device()
	{
		return $this->hasOne("App\Models\Devices", "id", "pid");
	}

}
